<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>广告-有点</title>
<link rel="stylesheet" type="text/css" href="css/css.css" />
<link rel="stylesheet" href="css/style.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<!-- <script type="text/javascript" src="js/page.js" ></script> -->
</head>

<body>
	<div id="pageAll">
		<div class="pageTop">
			<div class="page">
				<img src="img/coin02.png" /><span><a href="#">首页</a>&nbsp;-&nbsp;<a
					href="#">公共管理</a>&nbsp;-</span>&nbsp;意见管理
			</div>
		</div>
		<div class="page">
			<!-- banner页面样式 -->
			<div class="banner">
				<div class="add">
					<a class="addA" href="banneradd">上传广告&nbsp;&nbsp;+</a>
				</div>
				<!-- banner 表格 显示 -->
				<div class="banShow">
					<table border="1" cellspacing="0" cellpadding="0">
						<tr>
							<td width="66px" class="tdColor tdC">序号</td>
							<td width="315px" class="tdColor">图片</td>
							<td width="308px" class="tdColor">名称</td>
							<td width="450px" class="tdColor">链接</td>
							<td width="215px" class="tdColor">描述</td>
							<td width="180px" class="tdColor">排序</td>
							<td width="125px" class="tdColor">操作</td>
						</tr>
					<c:forEach items="${list }" var="list">
						<tr>
							<td>${list.id }</td>
							<td><div class="bsImg">
									<img src="/upload/${list.picture }">
								</div></td>
							<td>${list.name }</td>
							<td><a class="bsA" href="#">${list.address }</a></td>
							<td>${list.describes }</td>
							<td>${list.id }</td>
							<td><img class="operation delban"
								src="img/delete.png"></td>
						</tr>
<!-- 删除弹出框 -->
	<div class="banDel">
		<div class="delete">
			<div class="close">
				<a><img src="img/shanchu.png" /></a>
			</div>
			<p class="delP1">你确定要删除此条记录吗？</p>
			<p class="delP2">
				<a href="deleteadv?id=${list.id }" class="ok yes" onclick="del()">确定</a><a class="ok no">取消</a>
			</p>
		</div>
	</div>
	<!-- 删除弹出框  end-->						
					</c:forEach>
					</table>
					<div class="fydiv"> <ul class="fenye">
					<c:if var="firstPn" test="${pn le 1 }">
						<li class="prev">首页</li><li class="prev"> 上一页</li>
					</c:if>
					<c:if test="${!firstPn }">
						<li class="prev"><a href="lgetAdvertisement?pn=1">首页</a></li> 
						<li class="prev"><a href="lgetAdvertisement?pn=${pn - 1 }">上一页</a> </li>
					</c:if>
					
					<c:forEach var="i" begin="1" end="${pages }" step="1" varStatus="varstat">
						<c:if var="pagesPn" test="${pn eq i }">
							<li class="prev">${i }</li> 
						</c:if>
						<c:if test="${!pagesPn }">
							<li class="prev"><a href='lgetAdvertisement?pn=${i }'>${i }</a></li> 
						</c:if>
					</c:forEach>
					<c:if var="lastPn" test="${pn ge pages }">
						<li class="prev">下一页</li><li class="prev"> 尾页</li>
					</c:if>
					<c:if test="${!lastPn }">
						<li class="prev"><a href='lgetAdvertisement?pn=${pn + 1 }'>下一页</a> </li>
						<li class="prev"><a href='lgetAdvertisement?pn=${pages }'>尾页</a></li>
					</c:if>
					</ul></div>
				</div>
				<!-- banner 表格 显示 end-->
			</div>
			<!-- banner页面样式end -->
		</div>

	</div>


	
</body>

<script type="text/javascript">
// 广告弹出框
$(".delban").click(function(){
  $(".banDel").show();
});
$(".close").click(function(){
  $(".banDel").hide();
});
$(".no").click(function(){
  $(".banDel").hide();
});
// 广告弹出框 end

function del(){
    var input=document.getElementsByName("check[]");
    for(var i=input.length-1; i>=0;i--){
       if(input[i].checked==true){
           //获取td节点
           var td=input[i].parentNode;
          //获取tr节点
          var tr=td.parentNode;
          //获取table
          var table=tr.parentNode;
          //移除子节点
          table.removeChild(tr);
        }
    }     
}
</script>
</html>